package sk.xorty.domain;

public class Trade {

    private String id;
    private String direction;
    private String account;
    private String security;
    private String status;
    private int quantity;

    public Trade() {}

    public Trade(String id, String direction, String account,
            String security, String status, int quantity) {
        this.id = id;
        this.direction = direction;
        this.account = account;
        this.security = security;
        this.status = status;
        this.quantity = quantity;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getSecurity() {
        return security;
    }

    public void setSecurity(String security) {
        this.security = security;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    @Override
    public String toString() {
        return "Trade{" +
                "id='" + id + '\'' +
                ", direction='" + direction + '\'' +
                ", account='" + account + '\'' +
                ", security='" + security + '\'' +
                ", status='" + status + '\'' +
                ", quantity=" + quantity +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Trade trade = (Trade) o;

        if (quantity != trade.quantity) {
            return false;
        }
        if (account != null ? !account.equals(trade.account) : trade.account != null) {
            return false;
        }
        if (direction != null ? !direction.equals(trade.direction) : trade.direction != null) {
            return false;
        }
        if (id != null ? !id.equals(trade.id) : trade.id != null) {
            return false;
        }
        if (security != null ? !security.equals(trade.security) : trade.security != null) {
            return false;
        }
        if (status != null ? !status.equals(trade.status) : trade.status != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (direction != null ? direction.hashCode() : 0);
        result = 31 * result + (account != null ? account.hashCode() : 0);
        result = 31 * result + (security != null ? security.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + quantity;
        return result;
    }
}
